/*************************************************************************
	> File Name: main.cpp
	> Author: Wu Junqiang
	> Mail: 15769154659@163.com 
	> Created Time: 2018年01月22日 星期一 13时42分08秒
	> Note: test 
 ************************************************************************/
#include "DataMgr.h"
#include<iostream>
#include <list>
#include <iterator>
#include "Sport.h"
#include "User.h"
#include "Util.h"
using namespace std;

int main()
{
//	DataMgr* instance = DataMgr::instance();
/*
	if(instance->canRegister("26"))
	{
		cout << "success query user" << endl;
	}
	else
	{
		cout << "No this User!!!" << endl;
	}
	if(instance->Register("jiao1","nan"))
	{
		cout << "insert successful" << endl;
	}

	if(instance->CheckPassword("jiao","123"))
	{
		cout << "mima zhengque" << endl;
	}
	else
	{
		cout << "mima error" << endl;
	}*/

//	SportData data;
//	data.name = "jiao";
//	data.sportClass = "Oxygen Sport";
//	data.mac = "0x00000001";
//	data.sportTime="20180125";
//	data.group = "2";
//	data.groupNum = "2";
//	data.isStandard = "standard";
//	data.info = "hehe";

//	if(instance->SaveuserSportDate(data))
//	{
//		cout << "Save data is successful!!! " << endl;
//	}
//	else
//	{
//		cout << "Save data is failed !!!" <<  endl;
//	}


//	list<SportData> tt;
//	SportData t;
//	tt = instance->QueryuserSportData("jiao");
//	for(list<SportData>::iterator iter = tt.begin(); iter != tt.end(); ++iter)
//	{
//		cout << "name: " << iter->name << " sportClass: " << iter->sportClass << " mac: "  << iter->mac << " sportTime: " << iter->sportTime << " group: " << iter->group << " groupNum: " << iter->groupNum << " isStandard: " << iter->isStandard << " Info: " << iter->info << endl; 
//	}


//	Sport sport;
//	list<SportData> tt;
//	sport.SaveSportdata(data);
//    tt  =  sport.querySportdata("jiao");
//	for(list<SportData>::iterator iter = tt.begin();iter != tt.end(); ++iter)
//	{
//		cout << "name: " << iter->name << " sportClass: " << iter->sportClass << " mac: "  << iter->mac << " sportTime: " << iter->sportTime << " group: " << iter->group << " groupNum: " << iter->groupNum << " isStandard: " << iter->isStandard << " Info: " << iter->info << endl;
//	}


	time_t t = time(NULL);
	User user;
	Person person;
  // 	person = user.SetUserInfo("ceshi2","456","nv","34","165","65","45678",t);

//	user.AddUser(person.name,person.passWord);
	user.QueryUser("jiao");
//	user.UserLogin(person.name);

	return 0;
}
